<?php

namespace globalunit\utils;

use QYS\Log\Log;

class Qrcode
{

    /**
     * 获取小程序码 适用于需要的码数量极多的业务场景。通过该接口生成的小程序码，永久有效，数量暂无限制
     */
    public static function getWXACodeUnlimit($access_token, $scene, $page = '', $width = 430, $auto_color = false, $line_color =  ['r' => 0, 'g' => 0, 'b' => 0], $is_hyaline = false)
    {
        $body = [];
        $body['scene'] = $scene;
        $body['page'] = $page;
        $body['width'] = $width;
        $body['auto_color'] = $auto_color;
        $body['line_color'] = $line_color;
        $body['is_hyaline'] = $is_hyaline;
        $result = CoroutineCurl::request('api.weixin.qq.com', "/wxa/getwxacodeunlimit?access_token={$access_token}", 443, true, 'POST', $body);
        $result = $result['result'];
        return $result;
    }
}

